package com.longge.websocket.util;

import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;

public class ServerNodeUtils {
	private static Set<String> serverNodes = new CopyOnWriteArraySet<>();
	private static String currentNodeHost;
	
	public static String getCurrentNodeHost() {
		return currentNodeHost;
	}

	public static void setCurrentNodeHost(String currentNodeHost) {
		ServerNodeUtils.currentNodeHost = currentNodeHost;
	}

	public static void addServer(String host) {
		serverNodes.add(host);
	}
	
	public static void deleteServer(String host) {
		serverNodes.remove(host);
	}
}
